﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title> 
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />
    <link href="../../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>

    <script  type="text/javascript">

        $(function () {

            InitBar(DeliveryWay.ByStationAndEmpDept);

            //获取节点岗位
            var ens = new Entities("BP.WF.Template.NodeStations");
            ens.Retrieve("FK_Node", GetQueryString("FK_Node"));

            var html = "<table style='width:100%;' >";
            html += "<caption >已经设置的岗位,合计:(<font color=red>" + ens.length + "</font>)条</caption>";
            var idx = 0;
            for (var i = 0; i < ens.length; i++) {
                var en = ens[i];
                if (idx == 0)
                    html += "<tr>";

                html += "<td>" + en.FK_StationText + "</td>";

                idx++;
                if (idx == 3) {
                    idx = 0;
                    html += "</tr>";
                }
            }

            html += "</table>";
            document.getElementById("stas").innerHTML = html;

             

            //获取节点部门
            ens = new Entities("BP.WF.Template.NodeDepts");
            ens.Retrieve("FK_Node", GetQueryString("FK_Node"));


            var html = "<table style='width:100%;' >";
            html += "<caption >已经设置的部门,合计:(<font color=red>" + ens.length + "</font>)条</caption>";
            var idx = 0;
            for (var i = 0; i < ens.length; i++) {
                var en = ens[i];
                if (idx == 0)
                    html += "<tr>";

                html += "<td>" + en.FK_DeptText + "</td>";

                idx++;
                if (idx == 3) {
                    idx = 0;
                    html += "</tr>";
                }
            }

            html += "</table>";
            document.getElementById("dept").innerHTML = html;
             
        });


        function OpenStation() {
            var url = "../../../Comm/RefFunc/Dot2DotStationModel.htm?EnsName=BP.WF.Template.Selectors&EnName=BP.WF.Template.Selector&AttrKey=BP.WF.Template.NodeStations";
            var nodeID = GetQueryString("FK_Node");
            url += '&NodeID=' + nodeID + '&ShowWay=None&M=' + Math.random();
            OpenEasyUiDialogExt(url, '设置岗位', 800, 500, true);
        }

        function OpenNew() {
            var url = "../../../Comm/RefFunc/Branches.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeDepts&Dot2DotEnName=BP.WF.Template.NodeDept&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Dept&EnsOfM=BP.GPM.Depts&DefaultGroupAttrKey=";
            var nodeID = GetQueryString("FK_Node");
            url += '&NodeID=' + nodeID + '&PKVal=' + nodeID;
            OpenEasyUiDialogExt(url, '绑定部门', 800, 500, true);
        }
        function OpenOld() {
            var url = "../../../Comm/RefFunc/Dot2DotSingle.htm?EnsName=BP.WF.Template.Selectors&EnName=BP.WF.Template.Selector&AttrKey=BP.WF.Template.NodeDepts";
            var nodeID = GetQueryString("FK_Node");
            url += '&NodeID=' + nodeID + '&ShowWay=None&M=' + Math.random();
            OpenEasyUiDialogExt(url, '绑定部门', 800, 500, true);
        }

       function Save() {
           var nodeID = GetQueryString("FK_Node");
           var node = new Entity("BP.WF.Node", nodeID);
           node.DeliveryWay = DeliveryWay.ByStationAndEmpDept;
           node.Update();
           alert("保存成功.");
       }
    </script>
</head>
<body >

<div id="bar"> </div>

<table style="width:100%; border:0px;">
<tr>

<td style="width:50%;"> 

<fieldset>
    <legend>设置岗位</legend>

    <ul>
        <li>
             <a href="javascript:OpenStation()"> 设置与更改岗位</a> 
        </li>
    </ul>
</fieldset>
 </td>


 
<td style="width:50%;"> 
<fieldset>
    <legend>设置部门</legend>

    <ul>
        <li> 
            <a href="javascript:OpenNew()"> 设置/更改部门</a>
        </li>
        <li> 
            <a href="javascript:OpenOld()">设置/更改部门(旧版本)</a>
        </li>

    </ul>
</fieldset>
 </td>

</tr>
<tr>


<td  valign=top>
    <div id="stas"> </div>
  </td>

<td valign=top>   
    <div id="dept"> </div>
 </td>

</tr>




</table>






<fieldset>
    <legend>说明</legend>
    <ul>
        <li>该操作需要设置部门与设置岗位，两个设置。</li>
        <li>当前节点的处理人员需要求两个集合的交集。</li>
        <li>比如:在岗位里设置部门经理岗位，在部门里设置财务与人力资源两个部门。</li>
        <li>系统就会得到两个人员集合，第一个集合是所有具有部门经理岗位的人员，第2个集合就是财务部，人力资源部所有的人员。</li>
        <li>两个的交集就是一个财务部经理于一个人力资源部经理。</li>
    </ul>
</fieldset>


</body>
</html>
